﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation">
    
    <ResourceDictionary.MergedDictionaries>        
        <ResourceDictionary Source="Brushes.xaml"/>
        <ResourceDictionary Source="Effects.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="LayoutRootStyle" TargetType="Grid">
        <Setter Property="Background" Value="{StaticResource BrushAppBackground1}"/>
    </Style>

    <Style x:Key="BorderBackgroundStyle" TargetType="Border">
        <Setter Property="Background" Value="{StaticResource BrushAppBackground2}"/>
    </Style>
    
    <Style x:Key="SheetStyle" TargetType="Grid">
        <Setter Property="Width" Value="800"/>
        <Setter Property="Background" Value="{StaticResource BrushSheetBackground}"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Effect" Value="{StaticResource EffectSheetShaddow}"/>
        <Setter Property="Margin" Value="0 0 0 50"/>
    </Style>

    <Style x:Key="HeaderBorderStyle" TargetType="Border">
        <Setter Property="Background" Value="{StaticResource Brush1}"/>
        <Setter Property="Margin" Value="1 0"/>
    </Style>

    <Style x:Key="HeaderBackgroundStyle" TargetType="Border">
        <Setter Property="Background" Value="{StaticResource BrushHeaderBackground2}"/>
    </Style>
    
    <Style x:Key="HeaderTextStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource BrushHeaderText}"/>
        <Setter Property="FontSize" Value="20"/>
        <Setter Property="FontFamily" Value="Trebuchet MS"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Margin" Value="25 25 0 0"/>
    </Style>

    <Style x:Key="SubHeaderTextStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{StaticResource BrushHeaderText}"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="FontFamily" Value="Trebuchet MS"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Margin" Value="25 55 0 0"/>
    </Style>
    
    <Style x:Key="PageHeaderStyle" TargetType="ContentControl">
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Background" Value="{StaticResource BrushPageHeaderBackground}"/>
        <Setter Property="Height" Value="25"/>
        <Setter Property="Padding" Value="5 0 5 0"/>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid>
                        <TextBlock Text="{Binding Path=Title, ElementName=Page}" FontFamily="Trebuchet MS" 
                               Foreground="{StaticResource Brush2}" FontSize="12" FontWeight="Bold" 
                               HorizontalAlignment="Left" VerticalAlignment="Center"/>
                    </Grid>                    
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <Grid>
                        <Border Background="{TemplateBinding Background}">
                            <Grid>
                                <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  Margin="{TemplateBinding Padding}" HorizontalAlignment="Left"/>
                                <ContentControl Content="{TemplateBinding Content}" 
                                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                Margin="{TemplateBinding Padding}" HorizontalAlignment="Right"/>
                            </Grid>
                            
                        </Border>
                        
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="LinksPanelStyle" TargetType="Panel">
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Height" Value="50"/>
        <Setter Property="Effect" Value="{StaticResource EffectHeaderLinksGlow}"/>
    </Style>
    
    <Style x:Key="HeaderLinksStyle" TargetType="HyperlinkButton">
        <Setter Property="FontFamily" Value="Trebuchet MS"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="Foreground" Value="{StaticResource Brush1}" />
        <Setter Property="BorderThickness" Value="1 0 1 1"/>
        <Setter Property="BorderBrush" Value="{StaticResource BrushHeaderLinkBorder}"/>
        <Setter Property="Padding" Value="4 0"/>
        <Setter Property="Margin" Value="1 0"/>
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Background" Value="{StaticResource BrushHeaderLinkBackground}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal"/>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0:0:0" Duration="0:0:0"
                                                                               Storyboard.TargetName="contentPresenter"
                                                                               Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource Brush3}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>

                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            
                            <VisualStateGroup x:Name="LinkStates">
                                <VisualState x:Name="ActiveLink">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="0:0:0" Duration="0:0:0"
                                                                               Storyboard.TargetName="root"
                                                                               Storyboard.TargetProperty="Margin">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="0 0 0 -15"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InactiveLink"/>
                            </VisualStateGroup>

                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>

                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused"/>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border x:Name="root" CornerRadius="0 0 5 5" Background="{TemplateBinding Background}"
                                BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                            <Grid Cursor="{TemplateBinding Cursor}">
                                
                            
                                <TextBlock x:Name="contentPresenter" Foreground="{TemplateBinding Foreground}"
                                                    Text="{TemplateBinding Content}"
                                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                    Margin="{TemplateBinding Padding}"
                                                    Effect="{StaticResource EffectSunk}"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ContentFrameStyle" TargetType="navigation:Frame" >
        <Setter Property="BorderBrush" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="UriMapper">
            <Setter.Value>
                <uriMapper:UriMapper>
                    <uriMapper:UriMapping MappedUri="/Views/Home.xaml" Uri="" />
                    <uriMapper:UriMapping MappedUri="/Views/Customers/{pageName}.xaml" Uri="/{pageName}" />
                    <uriMapper:UriMapping MappedUri="/Views/{pageName}.xaml" Uri="/{pageName}" />
                </uriMapper:UriMapper>
            </Setter.Value>
        </Setter>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="Margin" Value="1 1 1 0"/>
    </Style>

</ResourceDictionary>
